Skip to content

feat(UI): add gpg-key setting#1397

Merged
benjamin-747 merged 1 commit into
gitmono-dev:mainfrom
yumeowo:main
Sep 1, 2025
Merged

feat(UI): add gpg-key setting#1397
benjamin-747 merged 1 commit into
gitmono-dev:mainfrom
yumeowo:main

Conversation

@yumeowo

@yumeowo yumeowo commented Aug 30, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Aug 30, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
mega Ready Ready Preview Comment Aug 30, 2025 3:10pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds GPG key management functionality to the user settings page, allowing users to view, add, and delete GPG keys associated with their account.

  • Adds new GPG key management UI component with list view, add dialog, and delete functionality
  • Creates three custom hooks for GPG key operations (get list, add key, delete key)
  • Integrates the new GPG key settings into the existing user settings page

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
moon/apps/web/pages/me/settings/index.tsx Imports and renders the new GPGKeys component in the settings page
moon/apps/web/hooks/usePostGPGKey.ts Hook for adding new GPG keys via API mutation
moon/apps/web/hooks/useGetGPGList.ts Hook for fetching and caching GPG key list with local storage
moon/apps/web/hooks/useDeleteGPGKeyById.ts Hook for deleting GPG keys by ID via API mutation
moon/apps/web/components/Setting/GPGKeys.tsx Complete GPG key management UI with list display, add dialog, and delete functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +23 to +24
<p className="text-base font-bold text-gray-900">{ keyData.fingerprint }</p>
<p className="text-sm font-mono text-gray-500 mt-1">{ keyData.fingerprint }</p>

Copilot AI Aug 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both lines display the same fingerprint value. The second line appears to be intended for a different piece of information (possibly key ID or a shortened version).

Suggested change
<p className="text-base font-bold text-gray-900">{ keyData.fingerprint }</p>
<p className="text-sm font-mono text-gray-500 mt-1">{ keyData.fingerprint }</p>
<p className="text-sm font-mono text-gray-500 mt-1">{ keyData.key_id }</p>

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +81
postGPGKey(
{
data: {
expires_days: 10,

Copilot AI Aug 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded expires_days value of 10 ignores the user-selected expires_days date from the form. This should use the calculated difference between the selected date and current date.

Suggested change
postGPGKey(
{
data: {
expires_days: 10,
// Calculate the number of days between now and the selected expiration date
const now = new Date();
const diffTime = expires_days.getTime() - now.getTime();
const diffDays = Math.max(1, Math.ceil(diffTime / (1000 * 60 * 60 * 24)));
postGPGKey(
{
data: {
expires_days: diffDays,

Copilot uses AI. Check for mistakes.
<h2 className="text-xl font-semibold text-gray-900 pb-2 border-b border-gray-200">
Authentication keys
</h2>
{ isGPGLoading? (

Copilot AI Aug 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before the question mark. Should be { isGPGLoading ? (

Suggested change
{ isGPGLoading? (
{ isGPGLoading ? (

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +116
{/*<div className='mb-4'>*/ }
{/* <TextField*/ }
{/* autoFocus*/ }
{/* label='title'*/ }
{/* value={title}*/ }
{/* onChange={setTitle}*/ }
{/* />*/ }
{/* {errors.title && <span className='text-red-500 text-xs'>{errors.title}</span>}*/ }
{/*</div>*/ }

Copilot AI Aug 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large block of commented-out code should be removed rather than left in the codebase. If this functionality might be needed later, consider using feature flags or version control history.

Suggested change
{/*<div className='mb-4'>*/ }
{/* <TextField*/ }
{/* autoFocus*/ }
{/* label='title'*/ }
{/* value={title}*/ }
{/* onChange={setTitle}*/ }
{/* />*/ }
{/* {errors.title && <span className='text-red-500 text-xs'>{errors.title}</span>}*/ }
{/*</div>*/ }

Copilot uses AI. Check for mistakes.
@benjamin-747
benjamin-747 added this pull request to the merge queue Sep 1, 2025
Merged via the queue into gitmono-dev:main with commit 073126d Sep 1, 2025
4 checks passed
slow2342 pushed a commit to slow2342/mega that referenced this pull request Sep 1, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Sep 1, 2025
…#1398)

* feat(orion-server): historical logs API & task_output refactor(#1379)

Signed-off-by: MYUU <1405758738@qq.com>

* feat(UI): add gpg-key setting (#1397)

* feat(orion-server): add error handling for file operations, remove task-output-segment

Signed-off-by: MYUU <1405758738@qq.com>

---------

Signed-off-by: MYUU <1405758738@qq.com>
Co-authored-by: Li WenLin <2839681263@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants